Filter on system attribute "Last Modified On"

Dear DOORS Experts,

please switch on the light in my head referring to the topic in the subject.

Why isn't works this:

Date dateOfInterest =  dateOnly(today)
Filter f = attribute "Last Modified On" >= dateOfInterest

 


Doesn't matter which operator I use, it won't work....

Thanks alot,
vasgyuszi

 


vasgyuszi - Thu Sep 30 09:56:20 EDT 2010

Re: Filter on system attribute "Last Modified On"
vasgyuszi - Fri Oct 01 03:19:41 EDT 2010

I've figured out:

the variable (to what will be the attribute compared) shall have 'string' type and not 'Date'.

BUT the attribute 'Last Modified On' HAS the type of Date.

Every logical and correctly implementeg programming language does comparing between identical types, but thic crappy DXL of course not. And of course it's nowhere documented. .... I could say some rude words... This very poor documentation costs alot of money for the projects they using DXL...

Re: Filter on system attribute "Last Modified On"
vasgyuszi - Fri Oct 01 06:52:31 EDT 2010

vasgyuszi - Fri Oct 01 03:19:41 EDT 2010
I've figured out:

the variable (to what will be the attribute compared) shall have 'string' type and not 'Date'.

BUT the attribute 'Last Modified On' HAS the type of Date.

Every logical and correctly implementeg programming language does comparing between identical types, but thic crappy DXL of course not. And of course it's nowhere documented. .... I could say some rude words... This very poor documentation costs alot of money for the projects they using DXL...

Well:

at "if" comparison shall be both variables from the same type (in my cas both Date):

if (<Date> >= <Date>){
...
}
BUT

for building a filter:

Filter f = attribute "Last Modified On" >= <string>

Who understands it???

Re: Filter on system attribute "Last Modified On"
Mathias Mamsch - Fri Oct 01 17:23:26 EDT 2010

vasgyuszi - Fri Oct 01 06:52:31 EDT 2010
Well:

at "if" comparison shall be both variables from the same type (in my cas both Date):

if (<Date> >= <Date>){
...
}
BUT

for building a filter:

Filter f = attribute "Last Modified On" >= <string>

Who understands it???

The reason is the DXL syntax. It is not only for filtering, also for the default value in attribute creation. DOORS uses undocumented datatypes to enable its syntax. Example:
 

AttrDef ad = create object attribute "NewAttribute" of type "Text"

 


doesn't this look nice?? Much like a natural language construct. Nice idea. Unfortunately this is done by a construct of undocumented perms and types:

 

 

 

AttrDef create (AttrDef__)
AttrDef__ object (AttrDef__)
AttrDef__ attribute (string)
_y of (_y)
AttrType__ type (string)
AttrDef__ ::.. (AttrDef__, AttrType__)
AttrDef__ ::.. (AttrType__, AttrDef__)

 


Lets take together all the perms for attribute creation:

 

 

 

 

 

 

 

 

AttrDef__ ::.. (AttrMultiVal__, AttrDef__)
AttrDef__ ::.. (AttrMultiVal__, AttrDef__)
AttrDef__ ::.. (AttrDefVal__, AttrDef__)
AttrDef__ ::.. (AttrLocaleVal__, AttrDef__)
AttrDef__ ::.. (AttrDef__, AttrDescVal__)
AttrDef__ ::.. (AttrDef__, AttrInhVal__)
AttrDef__ ::.. (AttrDef__, AttrBarsVal__)
AttrDef__ ::.. (AttrDef__, AttrDateVal__)
AttrDef__ ::.. (AttrDescVal__, AttrDef__)
AttrDef__ ::.. (AttrDef__, AttrLocaleVal__)
AttrDef__ ::.. (AttrDxlVal__, AttrDef__)
AttrDef__ ::.. (AttrDateVal__, AttrDef__)
AttrDef__ ::.. (AttrHideVal__, AttrDef__)
AttrDef__ ::.. (AttrHistVal__, AttrDef__)
AttrDef__ ::.. (AttrDef__, AttrDxlVal__)
AttrDef__ ::.. (AttrDef__, AttrHistVal__)
AttrDef__ ::.. (AttrInhVal__, AttrDef__)
AttrDef__ ::.. (AttrBarsVal__, AttrDef__)
AttrDef__ ::.. (AttrDef__, AttrHideVal__)
AttrDef__ ::.. (AttrDef__, AttrDefVal__)
AttrDef__ ::.. (AttrDef__, AttrMultiVal__)
AttrInhVal__ inherit (bool)
AttrDateVal__ date (bool)
AttrDxlVal__ dxl (string)
AttrDescVal__ description (string)
AttrHistVal__ history (bool)
AttrHideVal__ hidden (bool)
AttrType__ type (string)
AttrMultiVal__ multi (bool)
AttrLocaleVal__ locale ()
AttrDefVal__ default (string)
AttrBarsVal__ changeBars (bool)

 


Now wanting to have that same syntax with "type equality" they would have to split up the default perm for 6 different types: bool, string, real, text, integer, date.

Same with filters: The syntax there is "attribute name == value". You probably could have 6 different ::== operators defined:

 

 

 

 

 

 

 

 

Filter ::== (undocumentedType__, Date) 
Filter ::== (undocumentedType__, int ) 
Filter ::== (undocumentedType__, string) 
...
undocumentedType__ attribute (string)

 


Ok, so why did they not do it? Probably because in the end they store all that stuff to the database in text form anyway, so why bother. It was probably sluggishness.

But: Why don't you just add the the missing operators yourself?

 

 

 

 

 

 

 

 

Filter ::== (Fattr_ f, Date x) { return (f == stringOf (x, "MM/dd/yyyy")) }
 
Date d = today()
Filter F = attribute "Created On" == d
 
set F
filtering on

 


Hope that gives you some insight into the crazyness of DXL :-)

Regards, Mathias

 

 

 

 

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Filter on system attribute "Last Modified On"
Temperance - Sat May 05 11:37:28 EDT 2012

Hello DXL experts,

I am new to DXL, and after reading this last thread, I have a question regarding the system object attribute "Last Modified On". Is the date value returned from "Last Modified On" able to be compared to date value returned from the getdate() function ?

Re: Filter on system attribute "Last Modified On"
llandale - Sat May 05 16:58:00 EDT 2012

Temperance - Sat May 05 11:37:28 EDT 2012
Hello DXL experts,

I am new to DXL, and after reading this last thread, I have a question regarding the system object attribute "Last Modified On". Is the date value returned from "Last Modified On" able to be compared to date value returned from the getdate() function ?

"Last Modified On" gets set when you delete/undelete/move and object, or when you modify some attribute that has property "Affect change dates".

Historically this attribute, inexplicitely, only remembered the day of the change, not the time. Recently they added the capability to remember the time as well, but in order to preserve functionality of older DXL script, getting the value by definition only gets the Date. The getDateAndTime() function, et tal, will remedy that but it requires two statements rather than just one.

-Louie

Re: Filter on system attribute "Last Modified On"
Temperance - Sat May 05 19:28:26 EDT 2012

llandale - Sat May 05 16:58:00 EDT 2012
"Last Modified On" gets set when you delete/undelete/move and object, or when you modify some attribute that has property "Affect change dates".

Historically this attribute, inexplicitely, only remembered the day of the change, not the time. Recently they added the capability to remember the time as well, but in order to preserve functionality of older DXL script, getting the value by definition only gets the Date. The getDateAndTime() function, et tal, will remedy that but it requires two statements rather than just one.

-Louie

Hi Louie,

Thank you for your response.

So if I understand what you are saying correctly, "last Modified On" returns time and date, while getDate() only returns the date, with no time info.

If I want to compare just date information couldn't I use the dateOnly() function, like this ?

Date someday = dateOnly(Object."Last Modified On") then compare it with the return value from getDate()

(only because I couldn't find the getDateAndTime() function you referred to in your post)

What do you think ?

Thanks - Temperance

Re: Filter on system attribute "Last Modified On"
llandale - Mon May 07 11:46:25 EDT 2012

Temperance - Sat May 05 19:28:26 EDT 2012
Hi Louie,

Thank you for your response.

So if I understand what you are saying correctly, "last Modified On" returns time and date, while getDate() only returns the date, with no time info.

If I want to compare just date information couldn't I use the dateOnly() function, like this ?

Date someday = dateOnly(Object."Last Modified On") then compare it with the return value from getDate()

(only because I couldn't find the getDateAndTime() function you referred to in your post)

What do you think ?

Thanks - Temperance

Looks like I was wrong:

  • function is "dateAndTime"
  • obj."Last Modified On" indeed returns time of day


However, the following works indicating that "Today == ModOn" will compare the dateOnly version of ModOn. Not sure what is going on there.

 

Object    oCurr = current
int     cSecsInDay = 60*60*24
Date    Today  = dateOnly(dateOf(intOf(today())))
Date    Yestr  = dateOnly(dateOf(intOf(today())-cSecsInDay))
Date    ModOn  = oCurr."Last Modified On"
 
print (dateAndTime(ModOn)) "   \t" ModOn "\t" dateOnly(ModOn) "\n"
 
if     (Today == ModOn) then print "Object modified sometime today\n"
elseif(Yestr == ModOn) then print "Object modified sometime yesterday\n"


-Louie

Don't know why I'd think my DOORS dates would be easy, none of my dates are easy.